package com.wxd.service;

import com.wxd.config.WebConfig;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;

/**
 * @author wxd
 * @version V1.0
 * @description CustomBeanFactoryAware
 * @date 2022/10/12 16:12
 **/
public class CustomService implements BeanFactoryAware {
    private BeanFactory beanFactory;

    @Override
    public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
        this.beanFactory = beanFactory;
    }

    public void test() {
        WebConfig webConfig = (WebConfig) beanFactory.getBean("webConfig");
    }
}
